<?php
class Mivec_IO_Directory extends Mivec_IO_Abstract
{
	protected $_dir;
	protected $_fp;
	
	public function __construct($_dir)
	{
		$this->_dir = $_dir;
		return $this;
	}
	
	public function mkdir()
	{
		if (strpos($this->_dir,"/") !==false){
			$tmpArr = explode('/',$this->_dir);
			foreach ($tmpArr as $tmpDir) {
				$_dir.= $tmpDir."/";
				if (!file_exists($_dir)) {
					mkdir($_dir,0777);
				}
			}
		} else {
			if (!file_exists($this->_dir))
				mkdir($this->_dir,0777);
		}
		return $this;
	}
	
	public function getDir()
	{
		return $this->_dir;
	}
}